package wht.jly.forum.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import wht.jly.forum.domain.PostingType;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author lanyangji
 * @date 2019/2/8 20:41
 */
@Controller
public class BaseController {

    private static final String ANONYMOUS_USER = "anonymousUser";

    @GetMapping("/posting")
    public String posting(Map<String, Object> map) {

        PostingType[] postingTypes = PostingType.values();
        map.put("postingTypes", postingTypes);

        return "posting";
    }

    @GetMapping(value = {"", "/", "/index", "/index.html"})
    public String index(HttpServletRequest request) {
        return "index";
    }
}
